-
Notifications
You must be signed in to change notification settings - Fork 1
[EVAL] feat: add certificate trust configuration for MCP servers #14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[EVAL] feat: add certificate trust configuration for MCP servers #14
Conversation
- Add certificateTrust configuration options for SSE and StreamableHTTP transports - Support allowSelfSigned, caCertPath, and rejectUnauthorized options - Implement HTTPS agent configuration for Node.js fetch operations - Add comprehensive tests for certificate trust configuration - Add documentation explaining usage and security considerations Fixes #8355
- Use spread operator with type assertion for Node.js-specific agent property - Ensures compatibility with standard RequestInit type while allowing HTTPS agent
|
|
||
| // Handle certificate rejection | ||
| if (rejectUnauthorized === false || allowSelfSigned === true) { | ||
| agentOptions.rejectUnauthorized = false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logic for handling allowSelfSigned and rejectUnauthorized has a potential conflict. When allowSelfSigned is true, it unconditionally sets rejectUnauthorized to false (line 769), even if the user explicitly configured rejectUnauthorized: true. This means allowSelfSigned: true will always override an explicit rejectUnauthorized: true setting.
Consider using a more explicit precedence or only setting rejectUnauthorized when it's not already defined:
if (rejectUnauthorized === false || (allowSelfSigned === true && rejectUnauthorized === undefined)) {
agentOptions.rejectUnauthorized = false
}This same issue exists in the SSE implementation at line 839.
| - Certificate trust settings only apply to SSE and StreamableHTTP transports | ||
| - STDIO transport servers do not use HTTPS and therefore don't need certificate configuration | ||
| - The configuration requires Node.js environment; browser-based implementations may have different requirements | ||
| - Test webhook commit 17 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line contains a test artifact ("Test webhook commit 17") that should be removed before merging.
🧪 Evaluation PR for Testing
This is an automated test PR created for evaluation purposes.
Summary
This PR addresses Issue #8355 by adding certificate trust configuration support for MCP servers using HTTPS connections (SSE and StreamableHTTP transports).
Problem
MCP servers using self-signed or internal CA-signed certificates cannot be used because there's no way to specify trust information for these certificates. This prevents users from connecting to MCP servers in development environments or corporate networks with internal certificate authorities.
Solution
Added a certificateTrust configuration option for SSE and StreamableHTTP server types with three settings:
Changes
Testing
Security Considerations
Documentation
Added comprehensive documentation in docs/mcp-certificate-trust.md including: